﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="adminPower.aspx.cs" Inherits="Admin_adminPower"  %>

<%@ Register Src="adminfoot.ascx" TagName="adminfoot" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <link rel="stylesheet" href="imgs/admin.css" type="text/css" media="all" />
    <script type="text/javascript" src="../DotNet_net/js/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="imgs/GetAjax.js"></script>
    <script type="text/javascript" src="../DotNet_net/js/common.js"></script>
    <script type="text/javascript" src="../DotNet_net/js/jquery.form.js"></script>
    
</head>
<body onload="$('#loading').hide()">
   
<div class="container" id="cpcontainer">
<div id="loading" style="display:block" >   
    <div class="loading-indicator">   
        页面正在加载中...   
    </div>   
</div>
<ul id="makeHtmlTab">
<li class="hover"><a href="javascript:void(0)">查看权限</a>
    </li>
</ul>
    <table class="tb" id="TABLE1">
        <tr align="center">
			<td align="left" width="5%" style="height: 17px">
                权限ID</td>
			<td style="height: 17px; width: 13%;">
                权限名称(powerName)</td>
			<td style="width: 305px;">
                可操作页面(powerPage)</td>
            <td style="height: 17px; width: 371px;">
                所属模块(demoName)</td>
			<td  style="height: 17px; width: 267px;">
                模块名称（demoInfo）</td>	
                <td  style="height: 17px">
                    操作（编辑，删除）</td>	
        </tr>
       
        
        <asp:Repeater ID="Repeater1" runat="server">
        <ItemTemplate> 
        <tr align="center">
        <td align="left" width="5%" style="height: 17px"><%#Eval("powerId")%></td>
        <td><%#Eval("powerName")%></td>
        <td><%#Eval("powerPage")%></td>
        <td><%#Eval("demoName")%></td>
        <td> <%#Eval("demoInfo")%> </td>
        <td>
         <input id="Button5" type="button" value="编辑" class='btn' title='<%#Eval("powerId") %>' onclick="javascript:location.href='EditPower.aspx?pid='+this.title+'&state=edit'+$('#HiddenUrl').attr('value')"/>
	   <input id="btnDel" type="button" value="删除" class='btn' title='<%#Eval("powerId") %>' onclick="if(confirm('确定要删除吗')){$('#loading').show();ajax_get(convertURL('adminPower.aspx?state=delAll&pid='+this.title),'',function(msg){$('#cpcontainer').empty().append(msg);$('#loading').hide()});}else{return false}"/>
		<input id="btn" type="button" value="解除关联" class="btn"  title='<%#Eval("powerId") %>' onclick="if(confirm('确定要解除关联吗')){$('#loading').show();ajax_get(convertURL('adminPower.aspx?state=delTb&pid='+this.title),'',function(msg){$('#cpcontainer').empty().append(msg);$('#loading').hide();});}else{return false}"/>      
        </td>
         </tr>
        </ItemTemplate>
        </asp:Repeater>
        <tr><td colspan="6" style="height:24px"></td></tr>
        <tr><td colspan="6"><div class="pages"><%htmlPage();%></div></td></tr>
        </table>
        <%=input%>
        <br />
             <ul id="makeHtmlTab2">
<li class="hover"><a href="javascript:void(0)" onclick="">添加权限</a></li>
</ul>
<form name="addform" id="addformAjax"  method="post">
    <table class="tb" id="addRole">
    <tr class="thead"><th colspan="8" style="height: 25px">
        添加角色</th></tr>	
        <tr align="center">
            <td style="width: 92px" align="right" >
                权限名称：</td>
            <td style="width: 166px" align="left">
                <input id="Text1" style="width: 130px" type="text"  name="powerName"/><span style="color: #ff0000">＊</span></td>
            <td align="center" style="width: 98px">
                </td>
            <td align="left" >
                <span style="color: #ff0000"></span></td>
    </tr>
    
    <tr align="center">
            <td align="right" style="height: 32px; width: 92px;" valign="top">
                所属模块:</td>
            <td style="height: 32px; width: 166px;" align="left">
                <input id="Text2" type="text" name="demoName"/><span style="color: #ff0000">＊</span></td>
                 <td align="center" style="width: 98px; height: 32px;">
                     模块名称：</td>
            <td align="left" style="height: 32px" >
                <input id="Text3" type="text"  name="demoInfo"/><span style="color: #ff0000">＊</span></td>
    </tr>
    <tr align="center">
            <td align="right" style="width: 92px;" valign="top">
                可操作页面：</td>
            <td  align="left" colspan="3" >
                <span style="color: #ff0000"></span><div style="height:400px; overflow: auto; "><span style="color: #ff0000;" ><%=pageHtml()%></span>  </div>
              
                </td>
    </tr>
        <tr align="center">
            <td align="center" colspan="6">
                
                <input id="tijiao" class="btn" type="button" value="添加权限" name="Submit" />
                </td>
        </tr>
</table>
</form>
<uc1:adminfoot ID="Adminfoot1" runat="server" />
    </div>
    
</body>
    <script type="text/javascript">
$(document).ready(function(){
    var options = { 
        beforeSubmit:  showRequest,  // pre-submit callback 
        success:       showResponse,  // post-submit callback 
        // other available options: 
         url:       "adminPower.aspx?state=insert",         // override for form's 'action' attribute 
       // type:        'post'        // 'get' or 'post', override for form's 'method' attribute 
        //dataType:  null        // 'xml', 'script', or 'json' (expected server response type) 
        clearForm: false,        // clear all form fields after successful submit 
        resetForm: false        // reset the form after successful submit 
 
        // $.ajax options can be used here too, for example: 
        //timeout:   3000 
    }; 
    $('#tijiao').click(function(){
            $("#loading").show();
            $('#addformAjax').ajaxSubmit(options);
            return false;
    });
})
function showResponse(msg)
{ 
    if(msg=="1")
    {
        alert("添加成功!!!");
         $("#loading").hide();
        location.href=location.href;
    } 
    else
    {
         alert(msg);
         $("#loading").hide();
    }
}

function showRequest(formData, jqForm, options)
 { 		
    return true; 
} 

</script>
    <script type="text/javascript" >
    function changePage(name)
    {
//        var pid=convertURL($(name).attr("name"));
//        $.get(pid,'',function(data,state){$("#cpcontainer").empty().append(data)}); 
    }
    </script>
</html>
